<template>
    <div class="width-75 tc">
        <div class="flex z-header">
            <div @click="$router.back(-1)">
                <i class="iconfont icon-zuo m-t-18"></i>
            </div>
            <div class="fs-36">
                动态
            </div>
            <div class="fs-30 c-5f" @click="issue">
                发布
            </div>
        </div>
        <div>
            <textarea name="" id="" cols="30" rows="10" placeholder="来吧，尽情发挥吧..." class="textarea" v-model="condition">

            </textarea>
        </div>
        <div>
            <changeImg v-on:arr="toshow"></changeImg>
        </div>
        <div class="rd-site c-9">
            <i class="iconfont icon-dingweiweizhi fs-24 m-t-18 c-9"></i>添加地址
        </div>
        <div class="index-blank m-t-18"></div>
        <!--<div class="flex fs-30 z-header">
            <div>
                添加话题
            </div>
            <div>
                <i class="iconfont icon-you1 fs-28"></i>
            </div>
        </div>-->
    </div>
</template>
<script>
import { MessageBox } from 'mint-ui';
import { z } from '../assets/js/common'
export default ({
    data() {
        return {
            imgurl: [],//图片路径
            condition:""//地图内容
        }
    },
    methods: {
        toshow(msg) {
            // this.msg = msg;
            console.log(msg);
            this.imgurl.push(msg);
        },
        issue() {
            var params = new URLSearchParams();
            params.append("school.schoolId", localStorage.schoolId);
            params.append("dynamicBody", this.condition);
            params.append("image", this.imgurl);

            this.$http({
                method: 'post',
                url: localPath + '/dynamic/addDynamic',
                data: params
            }).then((response) => {
                MessageBox.alert(response.data.message);
                console.log(response.data.message);
            }).catch((error) => {
                console.log(error);
            })

        }
    },
    mounted() {
        document.addEventListener(z());
    },
})
</script>
<style>
.rd-site {
    width: 1.44rem;
    height: .42rem;
    margin: .3rem 0;
    border-radius: 21px;
    line-height: .42rem;
    background-color: #eeeeee;
}
</style>
